﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "IGraphicsGroupBase.h"
#include "NdbDataSchema.h"

namespace gcmp
{
    class Coordinate3d;

    /// \brief 缩放无关子类型
    SERIALIZABLE_ENUM_CLASS(EnZoomFreeSubType)
    {
        Curve2d, ///<  二维曲线
        Text,    ///<  文字节点
        Count    ///<  计数用
    };

    /// \brief 缩放无关图形节点
    ///
    /// 缩放无关图形节点下的子节点不跟随视图缩放比例缩放
    class GCMP_GRAPHICS_NODE_INTERFACE_EXPORT IGraphicsZoomFree : public IGraphicsGroupBase
    {
        DEFINE_CAST_DERIVED(IGraphicsZoomFree, IGraphicsGroupBase)

    public:
        /// \brief 析构器
        virtual ~IGraphicsZoomFree(void);


        /// \brief 设置局部坐标系
        /// \param pos 局部坐标系
        /// \return true-设置成功；false-设置失败
        virtual bool SetCoordinate(const Coordinate3d& pos) = 0;

        /// \brief 获取局部坐标系
        /// \return 局部坐标系
        virtual const Coordinate3d& GetCoordinate() const = 0;

    public:
        /// \brief 获取该二维图形上方向是否始终朝上进行绘制
        /// \return 该二维图形上方向是否始终朝上进行绘制：true-是；false-否
        virtual bool IsFaceUpward(EnZoomFreeSubType zoomFreeSubType) const = 0;

        /// \brief 设置该二维图形上方向是否始终朝上进行绘制
        /// \param zoomFreeSubType 局部坐标系
        /// \param isFaceUpward 该二维图形上方向是否始终朝上进行绘制：true-是；false-否
        /// \return 无
        virtual void SetIsFaceUpward(EnZoomFreeSubType zoomFreeSubType, bool isFaceUpward) = 0;

        /// \brief zoom free节点是否需要Zoomable
        /// \return bool
        virtual bool IsZoomable() const = 0;

        /// \brief 设置zoom free节点是否需要Zoomable
        /// \return 无
        virtual void SetZoomable(bool allZoomable) = 0;


    public:
        /// \brief 创建默认的缩放无关图形节点
        /// \return 缩放无关图形节点
        static OwnerPtr<IGraphicsZoomFree> Create();
    };
}//namespace gcmp



